cast index to int