Storing the hash in the database