update middleware lib