added disconnected function