fixed indexing on non-existent entries