changes all file modes to "a+" to simplify code