fixing issues with reusing replica exchange object