fixed withCredentials in ai.js