Fixed a bug where the script would reconnect 2^n times every 30 seconds