fixed bug in cl history indexing