hacky support for return_buffers and detect_buffers