added functions needed to prevent memory leaks while using the service locator