Fixed bug where database connection is not found