fix input from terminal