fixed some bugs when update to iOS7