fixed sqlite3 relational problem