bug fix, convert to int for index