Changed Database::getInstance() to follow singleton pattern