fix a bug on "delete component" : the component needs to be deleted from the JSON template