- added error checking and working on sqlite INSERT