trying out ways to end the reader thread