set ht to null so we don't double free on initialisation error