Added file existence check