fixes a bug in the evaluation of valid sequences