fix sql order bug