Added recursive copy logic