fixed close method on modules