fixed write in sqlite