added buffer size as cmd parameter