Fix sort problem