Fix array index out of bounds during last step of the playback