added counter to log statments