Fixed part 1 of login bug