added counting warnings and errors