added end notification code