updated for supporting legacy ie