Local ip function
Save on focus lost