IE8 filters compatibility

IE 8 doesn't have trim function for strings.