Changed error handling for SFTP