use buffered channel
fix Int type for -n cmd arg