fixing errors on saving models

Failing tests which are not related at all with this change... and in local they are passing...