fix authentication bug