Make the script idempotent