update js for eternal loops