@lslezak solved similar issue in registration code