fixed a bug in br replacement