Maybe move this outside of the function?