added controll of local storage