fixed some bug in ajax