fix orphaned strings and delete outdated strings