Fixing issue with ssh tunnel getting closed