fixing bug for non-logged in users