count is now also a terminate condition