Fix for internal server error when logged out user is viewing the site