partial revert of 97ee411