fix a subtle bug that broke many things