CWAssert for valid index