fixed bugs with the reconstruct tags function