added SIGHUP and SIGUSR1 as signals to exit the process.