fixes for code for tor