working code with new user reg. field n database