Fixed ajax calls to update function.