revised if else statment to determine status of logged in user