# Using Global get Ex on Noop call giving error when deploying app

**URL:** <https://forum.algorand.co/t/using-global-get-ex-on-noop-call-giving-error-when-deploying-app/5314>\
**Category:** General\
**Created:** [December 5, 2021, 6:49am UTC](https://forum.algorand.co/t/using-global-get-ex-on-noop-call-giving-error-when-deploying-app/5314 "2021-12-05T06:49:15Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jjEvans](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@jjEvans](https://forum.algorand.co/u/jjEvans)\
**Post date:** [December 5, 2021, 6:49am UTC](https://forum.algorand.co/t/using-global-get-ex-on-noop-call-giving-error-when-deploying-app/5314/1 "2021-12-05T06:49:15Z")

</div>

I’m running the counter applications in the docs, and I made a small change: I’d like to check that the count value exists in state.

Because count is initialized to 0, I figured I could call global get ex with the current application ID and use the Maybe Value to do the check. However, I get the following error:

```auto
File "/usr/local/lib/python3.9/site-packages/pyteal/compiler/compiler.py", line 215, in compileTeal
    localSlotAssignments = assignScratchSlotsToSubroutines(
  File "/usr/local/lib/python3.9/site-packages/pyteal/compiler/scratchslots.py", line 95, in assignScratchSlotsToSubroutines
    raise TealInternalError(msg) from errors[0]
pyteal.TealInternalError: Encountered 1 error when assigning slots to subroutine

```

Here is the code: The only change between this and the counter (add, deduct) example in the official algorand docs is the first line , and the third line in the And block.

```auto
   myStatus = App.globalGetEx(Txn.applications[0], Bytes("Count")).hasValue()
   handle_noop = Cond(
       [And(
            Global.group_size() == Int(1),
            Txn.application_args[0] == Bytes("Add"),
            myStatus > Int(0)
        ),add],
        [And(
            Global.group_size() == Int(1),
            Txn.application_args[0] == Bytes("Deduct"),
        ), deduct]
   )

```

---

_[View the full topic](https://forum.algorand.co/t/using-global-get-ex-on-noop-call-giving-error-when-deploying-app/5314)._
