Added double threshold for volume detection.