refactored scheduler to wrap done callback to automatically remove tasks when done is called