remove closing pairs automatically