updated ios code from the other repo