Fix sorting and datatable nested form bug