use try catch in s:remove_trailing_space