Fix trim function call that was causing WPeC js fatal error

Was causing a js error when executed