Fixed checking whether the hashkey exists