fixed bugs, but deadlock