fix for empty arrays