Ah, I missed the return statement as your code isn’t formatted properly. You can add code snippets by wrapping them into three backticks ``` for easier debugging.
Your code should work, so feel free to post a minimal, executable code snippet reproducing the error.