[added] pirate ai saving framework in