Fixed next/back bug