ensuring file exists before chmod