Fixing bug related to connection is closed when release DB