Changed name of the function which execute the script functionality
Added loop to update the timeouts and deregistering on SIGTERM signal