reduced code down, fixes for IE8