fix: Erroneous $temp and $hash management