Added logic to insert members