fixed a bug related to ObjectDisposedException that may happen