Fix issue when registering model