fixed close-problem. overridden closeEvent seems to be the best way