Change delete to reset -> add boundary check