Adding trim function check for IE8 support