only check for the js variable a few times