handling for empty arrays