now checks if file exists