fix if expression bug

Solution by @hsk