update ajax request logic