fix bugs for ios