Fixed issue where error accured if user wasn't logged in.