fixed a bug in wrong hash calculation