Significantly better fix, props to collegue who spotted it