add guard to __del__ in case object is already deleted