fix close method