Fixed ajax bug