Added level parameter
Fixed issue with localStorage.history in chrome