bug (array sort doesn't create new instance in js)