added a withLocals directive which doesn't work yet.