fixed issue where speak button was not working. Rearranged some code