some small fixes, added counter