Fix bug in add model