fixing linking bug - better way