add ajax to save and sorting for tables