bugfix: initialize tor to NULL