Hooking into the before callback to attach a lockable middleware