fix callback before delete in main controller