fixing a bug in ANSI sequences