fix external model bugs