fixed bug in init method for localStorage