NULL not 0
non-blocking input handling