Move sequence validation check function to the right place