fix gen PI from batchid