fix stdin not readable multiple times