Fix '`before` is deprecated' issue