bug fix: the optimization didn't catch all cases