Fix crash: Correctly managing SQLite database.
Create singleton for database(need one instance)