fix method of checking for logged in user