Fixing issue with missing .trim() function in IE8