sync for ajax