Added support for beforeDelete and afterDelete