Fixed login flow and user profile issue