Add validation for password setting