fixed if(a) bug and error_count bug