Adapt for wai >= 3