added code to avoid stack overflow
now speech routing can be toggled