I did find a lot of questions on this topic but none of the answers seem to help my case. Problem is that the code that throws errors is almost the same as the one that works pe