fixes hash calculations