filter out invalid sequences