bug in handling escape sequences