added brepl and some fix