fix bug ajax function