add replace dependency method