check if dom exists (to stop an error if a component is deleted)