fix bug for linking