Added pin hash caching
Fixed logging