Fixes #6101 and #6105 by removing the saved function of the modal data