add index function to action.