Added state and pagination