Remove nesting. Use fat arrow for fail method to be able to close sftp client properly.