added error code for counting error