Also probably should null out the `monitoringTask` in a finally block.