remove task from the queue only if it has been successfully executed