changed atexit registration into decorator
fixes #85 to show errors as pop-up on Mac and PY3