added replica identifier, fixed repl bug