changed boolean to check if file exists