Added defensive code to IAPHelper