made sure there were enough bytes for the buffer