invoke function in the if check

Addressing issue #212