updated registration and function