trim string before processing