Fixed bug when trying to add targets