fix a bug where broken symlinks are not removed properly