removing trailing whitespace from headers