added workaround for not closing ttyread