fix for ANSI flag logic error