Fix for connection to db.