fix when sort field is nil