Merge files and improve folder locking