use localStorage when possible