remove extra space for unmodified buffer