fixed credential mediator/middleware issue