fixes bug in If() returning 'undefined'