removing the parent from the list when clicked