handle empty arrays/hashes