Fix template applying in IE