break out model
fix delete bug when model is added to the ui