Correcting prefix and backspace to only process for tag pairs