added some proper signal handlers