Internet Explorer workaround: .substr(-4) is not supported in <= IE8