fix counter when error, allow CORS from any