fixed comparison order bug