value of counter will be saved if user closes the app