call `trim` as method on the string

fixes error in chrome
Merge pull request #1 from mgax/fix-trim

call `trim` as method on the string