Making script idempotent.