Added logic to allow more than one target.