fix close error bug