Fixed code attempt to access data that requires login without checking if the user is logged in.