remove semophore from signal_catch and add while to semophore wait