fixed error calculating target