Modify password confirmation example

the validation is triggered only when it is present and not nil