Fixing an issue where a hash was being constructed multiple times