Fix JFrame not closing