Tried to fix buffer problem