trying to fix several bugs on speech recognition