support passing objects as targets