make bracket notation on arrays work with undefined indexes