Corrected iOS code