add close method for mock session