Add method sort for array in afm object