Fixed invalid pointer error in IE8