added ajax update function