added old entity as parameter for updates and added before delete hook