IE8 fix on calculation