added increment in errors count when file empty