Added check for login for main