Update settings on form closing