Modified to work with Internet Explorer