last commit didn't quite finish fixing the referred bug, this commit did