Bug fix: checking for accept state only at the complete match