added first and last page to pagination