Added error logging
More error logging!
reconfigured the sqlite database