fixed error - indexing null list