Added capturing Ctrl+C to terminate the process