Added singletone control for the database