fixed err with populating array datat