fixed a silly bug on sorted merge