add terminate method to module