fix rule for valid sequences