fixed the function and trying through notifications