added check to see if db url is defined