check for arrayindex out of bounds