fix write PSI for model