allow passing element as target; change api