[SJS-171][BUG]: Fix for uncaught type error when doing reconnection attempt.
[SJS-170][TEST][WIP]: Added check if channel is closed properly first