Controlling error output by flag. Moving check for null state into
update hok.