added check sequence function