changed getTagAsArray function using jquery.map function