update ajax function.