Fixed checking if file exists