Added process cleanup to kill the script cleanly