Add safe indexing