fix for debug entities removal