updated crud functionality