fix problem with write data to sqlite.