modified signal handler to call my terminate method. method to be implemented