fix checkmodel() function (whoops)