added pagination logic on frontend