added support for blocks with StringWriter