Added db lookup for profile env