Update database.php fixed multiple instances

Fixed the problem with using multiple instances and reusing them.