working previous pagination