more robust and idempotent