fixed if else bug that Jim found.