changed implementation of Provider to support multiple instances