fixed sorting by field type