fix broken input via stdin