fixed ascending order bug