better place to put this cleanup code