adjust code to work with the ajax helper