edit data for ajax