fixed halting on input read