ng: fix sorting problem