fixed valid index test