Tested and fixed for IE and Chrome