bug fix for deleting multiple entities