re-writing the ajax