resolve #8 and also fix bug where hash value of 0 was invalid