fixed deadlock in move function