Fixed up bug when uploading to server in iOS