checking message id before cancelling a task