Fixed iOS code not compiling & crashing