fix bug with writing to the auth file