Fixing the issue with database. It seems like Sqlite3 hates me and loves to make my life miserable