I am soryy for not posting sooner. I have been on a leave. I fixed this issue by removing a function that was unnecessary to the main task of the code. I believe it was a function to log some data that I wanted for future reference, but did not have a pressing need for and I felt I could add the function later if it became necessary.