Fix lateness

Fixed recording lateness problem
Added ability to stop the scheduler