added full on_delete implementation