Modified isIndexAffine

Modified method signature to pass current for statement and also added a check