bugfix to linking