fixed regression bug (playback error)
code cleanup