Fixed IE8 bug

Fixed IE8 exception, cannot pass in undefined or null to IE8's Function.prototype.apply