dispose only when there is a hit on the function