Fixing sqlite3 error