Added replica lock functionnality.