Update registration bug

Update registration code if validation code is correct