fix bug reported in IOS