fixed substatement validation