performance fix for multiple targets

not booletproof but works in my setup