closing cursor on delete