Wrap in try..catch and us an alternative test for IE<9!!