Changing db constructor