fix domain deletion (2 bugs)