Fix replica. Now finally working