fixed bug with remaining sequences