fix bug in replaceThis methods and made guards eden variables