Fix bugs with block unblock
Added disconnect function