fix bugs, support ios6