fix to speed up the processing.