fix bug on tokenstream delete