fix bug in handling last revisions