fix error and remove regex index