don't use getchar().

    because getchar() moves cursor to a command line.
    however, this change makes check weak.