added counter/ clear and bugfix