styling change: Do not use assignment inside conditionals
do not print error messages when connection is simply closed