Adding functionality to disconnect