fixed duplication of hash creation