befor model update from database