use the correct file modes