Added timer code in play() and pause()