Fixed bug where database would not connect