made IAP operations safer