added support for localStorage