handling empty arrays