fixed error in allocating control buffers