Fixed problem with unregistering model