virtual void close method was added