better and much easier solution for next prev buttons. serverside