fix empty and error count