fix liblast logic