fix notification by creating external function