add counter and directory