Add an if then statement to take care the user login issue