Fix unknown entity error on delete