fix call to factory and not localStorage directly