fix some iOS bugs