Check models in other functions.  You should also check dev != NULL first to avoid crashes