fixed the issue that might call on a closed sqlite db