Bugfix for database connection