fixed bug with target ordering