changed more sqlite3 calls to dbi