fixed nil array instead of empty array issue