error count is now checked before it is created