polished the ajax request