use dependency inject successfully