fix notify function