call `trim` as method on the string

fixes error in chrome