added a if user is logged in