did a dd(gettype($sandbox['total'])) before this. returns string. so that it did not return when $sandbox['total'] is 0.