added locals to middleware renderer