fix linking order