add signal handler, more logging