Made serial connection work with swing