fixed minor bug in ArrayBuffer