Added a check for a User being logged in