added null return if ->isLoggedIn() returns false