add first version of signal handling