Added isSandbox check around the __toString check