added SIGTERM handling for clean stop when installed as a service
updated