fixed error detection condition

in scoring loop script