Fix js sort error