Fixing deadlock in logging!