added connect/disconnect callbacks