added pause and stop buttons. Also fixed persistent state issue.