watch refs before script fn call