Changed so main will block until the termsig is caught