added some alerts in iOS. Added some exception throwing.