finished user registeration function