resolve CORS problems, and save credentials problem