modify the update ajax function