An Architecture for Self-healing in Internet of Things