Fix bugs and add Pagination