force idx to integer