handle empty buffers