Added support for localStorage