fix input on redirected stdin