fix trailing whitespace matching