fixed prev/next bug