Fixed bug where connected to database was printed even if no database was preset