speed optimization for resolve_target()

tags: relevant
handler() was missed sometimes

tags: relevant