remove trailing spaces after percent