Fixing IE script execution order problems