fix order in matching