fixed errors in model