fix TARGET logic