Bugfixing wrong if for target exist