fixed bugs in target selection