Fix a bug on target selection