bug fixes for replay