err func for notify exit