Trying to solve a bug with the ajax response