handling disconnected peripheral