use alarm() instead of kill() so signal gets delivered to main thread