Check if there is something in the output buffer before deleting it