updated close operation