fixing onset detection