finish the input from stdin