fix stupid bug when using with --reverse option