method to set active view controller by index