added sequence checking
added sequence checking