# Can i use 'bz' and 'return' in stateless smart contract

**URL:** <https://forum.algorand.co/t/can-i-use-bz-and-return-in-stateless-smart-contract/3974>\
**Category:** Uncategorized\
**Created:** [August 10, 2021, 5:23pm UTC](https://forum.algorand.co/t/can-i-use-bz-and-return-in-stateless-smart-contract/3974 "2021-08-10T17:23:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wenhaolin](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@wenhaolin](https://forum.algorand.co/u/wenhaolin)\
**Post date:** [August 10, 2021, 5:23pm UTC](https://forum.algorand.co/t/can-i-use-bz-and-return-in-stateless-smart-contract/3974/1 "2021-08-10T17:23:15Z")

</div>

when i use algodClient.compile to compile teal with ‘bz’ or ‘return’. i got bad request (through purestake)

---

<div class="post-metadata">

**Author:** ![fabrice](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fabrice](https://forum.algorand.co/u/fabrice)\
**Post date:** [August 11, 2021, 1:00am UTC](https://forum.algorand.co/t/can-i-use-bz-and-return-in-stateless-smart-contract/3974/2 "2021-08-11T01:00:59Z")

</div>

Welcome to Algorand!

`bz` and `return` require TEAL v2.  
Do you have  
`#pragma version 2`  
or later  
at the top of your TEAL code?

Be careful: if your code was written for TEAL version 1, you **MUST NOT** just add the above pragma as the resulting code would most likely be **insecure**. You **MUST** first carefully read the guidelines: [Guidelines - Algorand Developer Portal](https://developer.algorand.org/docs/reference/teal/guidelines/) In particular, you **MUST** most likely check the `RekeyTo` field.

If you are already using TEAL v2 or later:

- Can you provide the full code (both TEAL code and code to call the API) you used?
- Have you tried to use [https://testnet.algoexplorerapi.io](https://testnet.algoexplorerapi.io) (no token)? Does it give the same error?
- Have you tried to compile using `goal clerk compile`, e.g., in the sandbox?
