attempt of implementing a signal handler