added first and last button with paging fixes