handle signal with trap