Fix Javascript error for not logged in visitors