fix resizable byte buffer issue