Used data attribute instead of hidden field, added unit test