working on #239

@ianb when you get a chance - can you help me debug this?