Added logic to handle adding member