So the actual issue had nothing to with this method which you all were right. The issue that I was stuck on for almost 4 days was because I didn’t correctly name a variable which was causing this error in my program. I appreciate all of your help and advice.