Fixed bug where counter value was lost after screen rotation