Added Exception handling for file existence and Linux/Windows directory structure