[Change] rewritten close method with using blocks