fixed some model functions