fix scenario where user had to login twice