moved init to register method