Bug fix for login