Added support for local storage and few fixes