fixing authentication bug