Fixed issue where different filepaths were being used to save and to check if it exists