Simplified iniailization and onUpdate.
Fixed a bug that occured when all the tabs were closed.