only set hash if hash actually changed