change output when encounter error
add non-blocking keyboard input