Added conditional password validator