fix close reason string handling