Adds check for file existence