fixed ifStatement() and function call issue