`serious bug fix for flex matching `state stack