empty buffer on error