add signal handling for OSX/Linux