remove unused variable
making logged in check public
fix the incorrect if condition in previous commit