correct bug for cross-correlation