minor bugs correction and insert to sqlite class

- minor bugs correction
- insert to sqlite class