Added file existence checks