make vars middleware run before render