Updated to fix dependency bug and mediator context