checked the array for empty