FTP Upload script not closing connections

I have a hazel script that watches a folder and when a file is placed into it, it connects to a remote FTP server, uploads the file and moves the files to a "Done" folder.
I have been having what I thought was a password reset problem on my end, but turns out the script is keeping 10 active connections open on their server, so we are maxing out the number of concurrent connections and thus getting shut down when attempting a new one.
They tried to adding a setting to kill any connection after 30 minutes of inactivity, which should've solved this issue. But didn't.
Is it possible to adjust the hazel script to close the FTP connection after the upload is successful?
I have been having what I thought was a password reset problem on my end, but turns out the script is keeping 10 active connections open on their server, so we are maxing out the number of concurrent connections and thus getting shut down when attempting a new one.
They tried to adding a setting to kill any connection after 30 minutes of inactivity, which should've solved this issue. But didn't.
Is it possible to adjust the hazel script to close the FTP connection after the upload is successful?