fixed crashing bug in scan_sqlite