fixed Buffer bug