support passing in an array or fn