fixed missing error increment