bugfixes, added routing functions