adding basic local vars to mddleware