fixed conditioning bug