Fixed bug in text to speech implementation