fixed a bug in sequence generator