fixed table sort bug