guard against nonexistent slices