refactored to use a variable from a service to provide root url