added end notificitaion code