add notify middleware