revert checkIfFileExists to check only for files and not folders.