changed the way of pickling model