fixed simulator bug, it stuck in infinite loop in case of unmatched
token