Fixing toArray not working on HTMLCollections