also check for empty array