"IF" returns error for false result (what is expected behaviour?)