reuseable signal handling mechenism