thread priority and some logging crap