Fixed BufferedReader exception when closing GUI