use jQuery trim instead of Javascript trim