improved the CORS filter