ML: error exists check