moved next/prev code so design layout not effected