update ajax functions (should work)