Solved by ptrblck in post #2 
              
              
                I haven’t checked your code, as you’ve posted images in the folder. 
However, this post might be helpful, which shows a manual implementation to fix another user error.