added close method.