add javascript function sort