fixed incorrect buffer parsing