You are way off base and don't have a grasp of what your code is or os not doing. Exist() checks for the existence of files or folders, not vars. You need to debug your code to gain an understanding of why it is failing, not trial and error code.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.