table sorting now works