Console middelware fix