Fix buffer issue