bug fix for checking index