sorting should now work and types returned correctly