fixing a bug of setH.