Changes delegate to used cached SID.

This is a better fix for the <SID> bug. Uses the SID
function. More robust and improves performance of delegates.