fixed model bug