changed ajax function.