fixed nil return issue on nested hashes after the first