fix some bugs, but still cannot use sqlite3_open, waited to be fixed