properly shutdown on ctrl-c
allow for external localStorage usage