fix the convertToBuffersMessage function