resolving deadlock issue