allow destinations to be functions