ensure server is closed after attempts to connect
remove unnecessary parenthesis