Fixing bug when connecting to FTP