Added checking if a file exists