fixed some problem in models