Trying to fix the deadlock issue