Fixed up deadlock issue