modify rebound logic