call cleanup() instead, and move whatever code you need to there.  there is code in two places currently and that can be hard to maintain.