added cache to hash collection and handled metadata errors