Bug fix for user login