Fixed bug with null listeners
Removed use of localstorage