apply trim to avoid linebreaks