added current variable and page number catching for adding prev next