fix to close opened connection