fix wrong code path