Added email notification; I also changed how the script exits in case of exceptions, now no longe exisint with exit code 0 when there are issues