change service to factory
bug fix