fixed getVisibleIndex problem