fixing up due to seg fault. model class changes