Changed hash function so that Query stored the computed hash