changed sorting js