added localStorage functionality