Changed implementation to fix the bug whle adhering to the original post-conditions of the replay method