Fixing bug with replay mode