Fixed automatic starting and stopping recording

timing related bug. The timer was not reseted consistently.