ref #8 - fix if statement