Change check of the passed sort order