(ref #201) rewrite repl not to encounter the bug