fix on target calc. thanks to A Ko