Fixed some ios bugs