some fixing in registration func