fixed an issue where it calls back more than once on arrays, added tests to prevent regression