Fixed bugs  - closing curly bracket & connection reopen attempt