silly hack to avoid double defer, really need to abstract this out to gem