Using STM, was pushing IORefs a bit too far