Yes, this works, and it's how I've seen it done in many examples online. I can see the value in having a custom message too though, so I've updated it to add that.