fix detached state after a move/rename