delete logic