I have the following code, which used to work very well, but I have noticed that it currently has some things that are depreciated and I assume that there is the part of the