Add pagination + fix database setting