fixed a bug that kept me up for hours at night