added connect/disconnect managing