fix for hash calculation