added test for sort bug