Fixed warnings if not user not logged in

Fixed warning if not user not logged in