add correction for reverse order bug