check for negative index