fix error if user wasn't logged in