Fixed error when not logged in