Implmented SIGHUP/Optimized code.