Add localStorage function.