Same for the private close method