code and style fix for IE9,8,7